‫Welcome to lecture three, and this is where we are going to start writing a piece I saw into this lecture,
‫we are going to be creating our first EPA as promised in the previous one.
‫So when we left here last time, we had created this EPA dopa fire inside of the air, P.M., you know,
‫beneath the master module instead of Europea next mustardy up that we created and installed on top of
‫our site.
‫So I'm hopeful that you have this configured into additive to create to a first EPA.
‫So how do we create a space in Europe next?
‫Remember this important frumpies very, very important piece.
‫Very important.
‫So don't overlook it makes you not on your inside of your file.
‫And then remember, this is Painton.
‫So for you to write your API, what you want to do is just to define a function.
‫And I will be working with the with the items items doctype like like I promised when you are starting
‫or you can also find that in the in the, in the, in the curriculum of this course.
‫So let me head over to items item.
‫It's the item list and I don't have any items.
‫You are going to be creating items here.
‫We are going to be at the end of this course creating items and removing and editing and doing all that,
‫the current operations using our API.
‫So if you want to write, for instance, an API that is going to fetch all the items for now this month,
‫I want to demo with this one.
‫I can just call this.
‫Get all items, get all items.
‫Remember, this is a function so defined.
‫Get our items.
‫And then here I want to write an ASCII wealth statement.
‫So let me tell you guys, do not be limited to what you can do with this theme.
‫This is just Python, the python that, you know, it is the square that you know.
‫So do whatever you want to do here.
‫This is your API.
‫You can do whatever you want to do with it.
‫So I want to show you a method that I use so much, the kind of queries that I write and I am able to
‫achieve almost everything that I want to do within Europeanised ecosystem.
‫So let me say, this is items.
‫This is a variable that's going to save my items.
‫And I am going to send this to Frappier.
‫But make sure you are getting this well, the don't dot and then I give Heskey well.
‫All right.
‫So we have Rapido the of this year and then here Mitu give six quotation marks and then inside of here
‫I am now going to write my statement like select this is Escutia that you know and I'm going to select
‫all.
‫We will be limiting this in the future.
‫And then from and the tables are named instead of Europea.
‫Next let me go to my dot p p p p my admin.
‫Here's what you can see this and I can see I have three database tables here.
‫I do not know which one.
‫I am using it on this side.
‫So how are you going to check this?
‫Just head back to your board, look for your side and my side is currently in.
‫Go to your side config file.
‫Remember in the previous lecture I explained to you that some things we had to do this file, so open
‫it in DBI name is this one.
‫So you're able to see which database, which database you are using on your project.
‫So it starts with fifty nine and ends with KDDI.
‫So now I can go back here and clearly it is this one.
‫So I open it and just look at the European names.
‫It's tables, it starts with Déby so tab and then the name of the table.
‫And if you need to get this table for instance, this one is not employee and then space Budinger,
‫then space activity.
‫When you're arguing with these types of tables on the inside of your API, what you need to do is to
‫put batiks, batiks, and then of course, now you can go ahead and provide the name of your table.
‫You're not interested in that.
‫Remember, we're interested in the items table, so I can just start taping item and disadvantage.
‫So let me just go back in to item.
‫And here is my top item, of course, the attack by the mobile division, all these items.
‫But we are interested in this one item.
‫I open it.
‫And by the way, let me mention how I am able to see, to use your opinion with my admin is that I have
‫installed our party on both ADT and then I am running my admin on top of that bot and therefore you
‫are able to access the databases.
‫Remember, your next use is Maria Déby is head of that board.
‫So what do you want to do here?
‫Check that and then we can see here we do not have any items for now, just like we can see from here.
‫And therefore, let's go back to Amarcord and remember to to get the name of this one.
‫So this is that item, this one, because it's just one one we don't need to put it inside of.
‫But even if you do this one and then what are you going to do here?
‫There's something like preened and then I'm going to do Poochigian Marks.
‫And just for the sake of seeing where I have printed, I'm going to do that.
‫Then I'm going to do four, five, six, so that the item that going to be printed here is going to
‫have spaces around it.
‫And since I am, I am putting this one inside of this discarded brackets, the I need to provide for
‫my dad sitting here and now because this one is done, I can go to my postman here, look at you, Tamino,
‫and think I need to stop this so that we create a little and then run away and start again, create
‫some room.
‫Here it is watching.
‫Let's wait for it to finish watching, to finish our loading.
‫And we can confirm by loading here when it is ready.
‫All right.
‫So as this one prepares to do its thing, get you get you get to a postman ready and I want you to supply
‫instead of your postman, open a new tab here.
‫You know, what I want you to give here is remember, you are running this thing on put on 40000.
‫And so you are going to put your board here so many thousand and three.
‫So I'm going to be posting this here.
‫So I have that.
‫And then the next thing I'm going to supply is API.
‫Remember, we are running on eBay and of course the next thing is method and the method is the next
‫mustardy.
‫And let me go back to the calls that you understand all this is so what we are doing here, API, you
‫supply API, you supply API because you want to interact with the ERP next API and then the next thing
‫is the method.
‫So the method, you just type method and then you want to ERP next, which may not want to get in.
‫Remember here to do that, this one is a method.
‫Remember this one is an app and this one is a method.
‫And then from here from the ERP next mustardy the next thing is their final data on to access.
‫So instead of your side of our ERP next mustardy, we have a file called Epitope.
‫So this what you want to access as the next thing and which is this file here and then the next thing,
‫which is API, which is which is this one is the method that you want to access.
‫So in this case it will be get all items and this is what they need to apply here.
‫Right.
‫So if you can't use, however, something else, make sure to supply this one inside of here so that
‫when you consent to this request, it is going to call this do whatever you have to to do here and then
‫print this thing on the Tamino.
‫And before you close here, you need to do that.
‫And then when we know, go ahead and send this one.
‫We are going to get our to get our response.
‫And by the way, even before we send it on postman, if you want to do it or their browser can just
‫based it on the browser, click on next.
‫And you can see this.
‫This is these are not permitted exceptions here.
‫So what this means is that you do not have permissions to do this because that EPA is protected.
‫We are going to be exploring more about the protection of APIs and how you can expose them later in
‫this course.
‫But in this one, I just want to show you how you can make that one open.
‫So would you want to do here?
‫We are going to be seeing frappé don't wait list for a bit of a wait list.
‫And then what do you want to do now?
‫Try again to send the same request.
‫Are you again here you are getting empty, right?
‫You are getting an empty array and there is an empty object and they just only you're getting an empty
‫object is clearly because you are table here is empty.
‫Right.
‫Your table here is empty.
‫The items table does not have items yet.
‫So apparently this one is working and we are we are going to be trying to send this thing inside of
‫Europeanised.
‫So send it in here.
‫You're going to get an exception.
‫This thing clearly doesn't work.
‫So you go to preview and you can see that you do not have enough permissions to complete this action.
‫What we are seeing here is closely related to what we are seeing on the browser when we sent it.
‫But on the browser, it is watching what is happening to our postman.
‫And remember, most of the applications that you are going to be using to consume this API will be outside
‫of ERP next.
‫Salt Lake, for instance, you are mobile app, maybe a mobile app that you have been working on.
‫Maybe it is.
‫It is.
‫And it is an application developed using angular.
‫Maybe it is an application developed using any other framework like, like react or whatever you are
‫using.
‫This is going to require you to know how to do this.
‫So I'm going to be delving into that later in the course.
‫So far for the purpose of this one.
‫Remember, it was just an introduction to APIs and this is already APIs and the waitlist function,
‫which makes sure that this function is opened and it can be accessed for.
‫And that is it sort when you go to the terminal here again, because we have we have requested that
‫you're going to be seeing there is some space somewhere and here you go.
‫There is space.
‫That is where we put these these bricks.
‫So we have the bricks before they are the object itself and three bricks after the object.
‫So what this does is that it creates this space here before and after, and this is our object.
‫So, again, the object here is empty because we do not have items in our table.
‫So as we carry on, we are going to be learning how to to to put items inside of this table from the
‫API.
‫You're going to learn how to delete them, update them and everything.
‫Everything cannot function that you know.
‫So I will stop here for this one, next one in the next.
‫Next year we are going to carry on with our API and see what we can do with it.
‫Thank you.
‫And see you in the next next year.